/**************************************************************
 *@ProjectName: blweibo
 *@FileName: FaceClickHealper.java
 *@Date: 2011-5-31
 *@Copyright: 2011 www.hrbanlv.com Inc. All rights reserved.
 **************************************************************/
package com.zhiweibo;

import android.view.View;

/**
 * The Class FaceClickHealper.
 * 
 * @author SunHaibin
 * @since Android 1.6
 * @history 2011-5-31
 */
final class FaceClickHealper {
    
    /** The activity. */
    private final EditActivity activity;
    
    /** The is face diaplay. */
    private boolean isFaceDiaplay = false;

    /**
     * Instantiates a new face click healper.
     * 
     * @param paramEditActivity
     *            the param edit activity
     */
    public FaceClickHealper(EditActivity paramEditActivity) {
        activity = paramEditActivity;
    }

    /**
     * Checks if is face diaplay.
     * 
     * @return true, if is face diaplay
     */
    boolean isFaceDiaplay() {
        return isFaceDiaplay;
    }

    /**
     * On click.
     * 
     * @param paramView
     *            the param view
     */
    void onClick(View paramView) {
        isFaceDiaplay = !isFaceDiaplay;
        activity.setEmotionViewVisibility(isFaceDiaplay);
        activity.setInputMethodVisibility(!isFaceDiaplay);
        if (isFaceDiaplay) {
            activity.displayKeyboardImageSrc();
        } else {
            activity.displayFaceImageSrc();
        }
    }

    /**
     * On finish.
     * 
     * @return true, if successful
     */
    boolean onFinish() {
        if (isFaceDiaplay) {
            activity.displayFaceImageSrc();
            activity.setEmotionViewVisibility(false);
            isFaceDiaplay = !isFaceDiaplay;
            return true;
        } else {
            return false;
        }
    }
}